#!/usr/bin/env python
#-*- coding:utf-8 -*-
'''
   unicode.py
   autor wenzhui
'''
CODE = 'UTF-8'
FILE = 'unicode.txt'

#hello_out = u"Hello World!"
hello_out = u"你好，世界!"
bytes_out = hello_out.encode(CODE)

f = open(FILE,'w')
f.write(bytes_out)
f.close()

f = open(FILE,'r')
bytes_in = f.read()
f.close()
hello_in = bytes_in.decode(CODE)
print bytes_in
print hello_in
